home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / oleo-1_4.lha / oleo-1.4 / configure < prev    next >
Text File  |  1993-05-23  |  21KB  |  923 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=io-term.c
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114. if test -z "$CC"; then
  115.   echo checking for gcc
  116.   saveifs="$IFS"; IFS="${IFS}:"
  117.   for dir in $PATH; do
  118.     test -z "$dir" && dir=.
  119.     if test -f $dir/gcc; then
  120.       CC="gcc"
  121.       break
  122.     fi
  123.   done
  124.   IFS="$saveifs"
  125. fi
  126. test -z "$CC" && CC="cc"
  127.  
  128. # Find out if we are using GNU C, under whatever name.
  129. cat > conftest.c <<EOF
  130. #ifdef __GNUC__
  131.   yes
  132. #endif
  133. EOF
  134. ${CC-cc} -E conftest.c > conftest.out 2>&1
  135. if egrep yes conftest.out >/dev/null 2>&1; then
  136.   GCC=1 # For later tests.
  137. fi
  138. rm -f conftest*
  139.  
  140. echo checking how to run the C preprocessor
  141. if test -z "$CPP"; then
  142.   CPP='${CC-cc} -E'
  143.   cat > conftest.c <<EOF
  144.  
  145. #include <stdio.h>
  146. EOF
  147. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  148. if test -z "$err"; then
  149.   :
  150. else
  151.   CPP=/lib/cpp
  152. fi
  153. rm -f conftest*
  154. fi
  155.  
  156. if test -z "$YACC"; then
  157.   echo checking for bison
  158.   saveifs="$IFS"; IFS="${IFS}:"
  159.   for dir in $PATH; do
  160.     test -z "$dir" && dir=.
  161.     if test -f $dir/bison; then
  162.       YACC="bison -y"
  163.       break
  164.     fi
  165.   done
  166.   IFS="$saveifs"
  167. fi
  168. test -z "$YACC" && YACC=""
  169.  
  170. if test -z "$YACC"; then
  171.   echo checking for byacc
  172.   saveifs="$IFS"; IFS="${IFS}:"
  173.   for dir in $PATH; do
  174.     test -z "$dir" && dir=.
  175.     if test -f $dir/byacc; then
  176.       YACC="byacc"
  177.       break
  178.     fi
  179.   done
  180.   IFS="$saveifs"
  181. fi
  182. test -z "$YACC" && YACC="yacc"
  183.  
  184.  
  185. # Make sure to not get the incompatible SysV /etc/install and
  186. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  187. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  188. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  189. if test -z "$INSTALL"; then
  190.   echo checking for install
  191.   saveifs="$IFS"; IFS="${IFS}:"
  192.   for dir in $PATH; do
  193.     test -z "$dir" && dir=.
  194.     case $dir in
  195.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  196.     *)
  197.       if test -f $dir/install; then
  198.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  199.       : # AIX
  200.     else
  201.       INSTALL="$dir/install -c"
  202.       INSTALL_PROGRAM='$(INSTALL)'
  203.       INSTALL_DATA='$(INSTALL) -m 644'
  204.       break
  205.     fi
  206.       fi
  207.       ;;
  208.     esac
  209.   done
  210.   IFS="$saveifs"
  211. fi
  212. INSTALL=${INSTALL-cp}
  213. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  214. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  215.  
  216.  
  217. echo checking for POSIXized ISC
  218. if test -d /etc/conf/kconfig.d &&
  219.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  220. then
  221.   ISC=1 # If later tests want to check for ISC.
  222.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  223.   if test -n "$GCC"; then
  224.     CC="$CC -posix"
  225.   else
  226.     CC="$CC -Xp"
  227.   fi
  228. fi
  229.  
  230. echo checking for AIX
  231. cat > conftest.c <<EOF
  232.  
  233. #ifdef _AIX
  234.   yes
  235. #endif
  236.  
  237. EOF
  238. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  239. if egrep "yes" conftest.out >/dev/null 2>&1; then
  240.   DEFS="$DEFS -D_ALL_SOURCE=1"
  241. fi
  242. rm -f conftest*
  243.  
  244.  
  245.  
  246. echo checking for ANSI C header files
  247. cat > conftest.c <<EOF
  248.  
  249. #include <stdlib.h>
  250. #include <stdarg.h>
  251. #include <string.h>
  252. #include <float.h>
  253. EOF
  254. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  255. if test -z "$err"; then
  256.   # SunOS string.h does not declare mem*, contrary to ANSI.
  257. echo '#include <string.h>' > conftest.c
  258. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  259. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  260.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  261. cat > conftest.c <<EOF
  262. #include <ctype.h>
  263. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  264. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  265. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  266. int main () { int i; for (i = 0; i < 256; i++)
  267. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  268. exit (0); }
  269.  
  270. EOF
  271. eval $compile
  272. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  273.   DEFS="$DEFS -DSTDC_HEADERS=1"
  274. fi
  275. rm -f conftest*
  276. fi
  277. rm -f conftest*
  278.  
  279. fi
  280. rm -f conftest*
  281.  
  282. echo checking for unistd.h
  283. cat > conftest.c <<EOF
  284.  
  285. #include <unistd.h>
  286. EOF
  287. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  288. if test -z "$err"; then
  289.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  290. fi
  291. rm -f conftest*
  292.  
  293. echo checking for directory library header
  294. echo checking for dirent.h
  295. cat > conftest.c <<EOF
  296.  
  297. #include <dirent.h>
  298. EOF
  299. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  300. if test -z "$err"; then
  301.   DEFS="$DEFS -DDIRENT=1" dirheader=dirent.h
  302. fi
  303. rm -f conftest*
  304.  
  305. if test -z "$dirheader"; then
  306. echo checking for sys/ndir.h
  307. cat > conftest.c <<EOF
  308.  
  309. #include <sys/ndir.h>
  310. EOF
  311. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  312. if test -z "$err"; then
  313.   DEFS="$DEFS -DSYSNDIR=1" dirheader=sys/ndir.h
  314. fi
  315. rm -f conftest*
  316.  
  317. fi
  318. if test -z "$dirheader"; then
  319. echo checking for sys/dir.h
  320. cat > conftest.c <<EOF
  321.  
  322. #include <sys/dir.h>
  323. EOF
  324. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  325. if test -z "$err"; then
  326.   DEFS="$DEFS -DSYSDIR=1" dirheader=sys/dir.h
  327. fi
  328. rm -f conftest*
  329.  
  330. fi
  331. if test -z "$dirheader"; then
  332. echo checking for ndir.h
  333. cat > conftest.c <<EOF
  334.  
  335. #include <ndir.h>
  336. EOF
  337. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  338. if test -z "$err"; then
  339.   DEFS="$DEFS -DNDIR=1" dirheader=ndir.h
  340. fi
  341. rm -f conftest*
  342.  
  343. fi
  344.  
  345. echo checking for closedir return value
  346. cat > conftest.c <<EOF
  347. #include <sys/types.h>
  348. #include <$dirheader>
  349. int closedir(); main() { exit(0); }
  350. EOF
  351. eval $compile
  352. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  353.   :
  354. else
  355.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  356. fi
  357. rm -f conftest*
  358.  
  359. for hdr in sys/time.h string.h memory.h sys/select.h
  360. do
  361. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  362. echo checking for ${hdr}
  363. cat > conftest.c <<EOF
  364.  
  365. #include <${hdr}>
  366. EOF
  367. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  368. if test -z "$err"; then
  369.   DEFS="$DEFS -D${trhdr}=1"
  370. fi
  371. rm -f conftest*
  372. done
  373.  
  374. echo checking for X11 headers and libraries
  375. dir=""
  376. cat > conftest.c <<EOF
  377.  
  378. #include <X11/Intrinsic.h>
  379. EOF
  380. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  381. if test -z "$err"; then
  382.   :
  383. else
  384.   if test -r /usr/local/include/X11/Intrinsic.h; then
  385.     dir=/usr/local/include
  386.  
  387.   elif test -r /usr/include/X11R4/X11/Intrinsic.h; then
  388.     dir=/usr/include/X11R4
  389.   elif test -r /usr/include/X11R5/X11/Intrinsic.h; then
  390.     dir=/usr/include/X11R5
  391.  
  392.   elif test -r /usr/lpp/X11/Xamples/include/X11/Intrinsic.h; then
  393.     dir=/usr/lpp/X11/Xamples/include
  394.  
  395.   elif test -r /usr/X11/include/X11/Intrinsic.h; then
  396.     dir=/usr/X11/include
  397.   elif test -r /usr/X11R5/include/X11/Intrinsic.h; then
  398.     dir=/usr/X11R5/include
  399.  
  400.   elif test -r /usr/openwin/include/X11/Intrinsic.h; then
  401.     dir=/usr/openwin/include
  402.   elif test -r /usr/openwin/share/include/X11/Intrinsic.h; then
  403.     dir=/usr/openwin/share/include
  404.  
  405.   elif test -r /usr/include/X11/Intrinsic.h; then
  406.     dir= # everyone's cc searches /usr/include, right?
  407.   else
  408.     no_x=t
  409.   fi
  410.  
  411. fi
  412. rm -f conftest*
  413. if test -n "$dir"; then
  414.   xincludedir=-I$dir
  415.   echo "(using $xincludedir)"
  416. elif test -n "$no_x"; then 
  417.   # Not all programs may use this symbol, but it won't hurt to define it.
  418.   xincludedir=-DX_DISPLAY_MISSING
  419. fi
  420.  
  421. #
  422. # Now check for the libraries.  Amazing how every single X vendor puts
  423. # these in a different place, and all because MIT thought they should go
  424. # in /usr/lib.
  425. dir1=""
  426. if test -r /usr/local/lib/libXt.a; then
  427.   dir1=/usr/local/lib
  428.  
  429. elif test -r /usr/lib/X11R4/libXt.sl; then
  430.   dir1=/usr/lib/X11R4
  431. elif test -r /usr/lib/X11R4/libXt.a; then
  432.   dir1=/usr/lib/X11R4
  433. elif test -r /usr/lib/X11R5/libXt.a; then
  434.   dir1=/usr/lib/X11R5
  435.  
  436. elif test -r /usr/lpp/X11/Xamples/lib/Xt/libXt.a; then
  437.   dir1=/usr/lpp/X11/Xamples/lib/Xt
  438.  
  439. elif test -r /usr/X11/lib/libXt.a; then
  440.   dir1=/usr/X11/lib
  441. elif test -r /usr/X11R5/lib/libXt.a; then
  442.   dir1=/usr/X11R5/lib
  443.  
  444. elif test -r /usr/openwin/lib/libXt.a; then
  445.   dir1=/usr/openwin/lib
  446. elif test -r /usr/openwin/lib/libXt.so; then
  447.   dir1=/usr/openwin/lib
  448.  
  449. fi
  450. dir2=""
  451. if test -r /usr/lpp/X11/Xamples/lib/Xmu/libXmu.a; then
  452.   dir2=/usr/lpp/X11/Xamples/lib/Xmu
  453. fi
  454. #
  455. # It would be nice to have a more robust check for the -R ld option then
  456. # just checking for Solaris.  The parentheses elide `uname: not found'.
  457. # It would also be nice to do this for all -L options, not just this one.
  458. if test -n "$dir1"; then
  459.   xlibdir=-L$dir1
  460.   if test "`(uname) >/dev/null 2>&1`" = SunOS && uname -r | grep '^5'; then
  461.     xlibdir="$xlibdir -R$dir1"
  462.   fi
  463.   #
  464.   # Don't need all that stuff for dir2, since it only gets used on AIX.
  465.   test -n "$dir2" && xlibdir="$xlibdir -L$dir2"
  466. fi
  467. #
  468. # Check for additional X libraries.
  469. # Since we already have an explicit check for POSIXified ISC, use it.
  470. if test -n "$ISC"; then
  471.   wlibs="$wlibs -lnsl_s -linet"
  472.   echo "(adding -lnsl_s -linet to wlibs)"
  473. else
  474.   # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
  475.   # libraries were built with DECnet support.  And karl@cs.umb.edu's Alpha
  476.   # needs dnet_stubs.
  477.   libname=`echo "dnet" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  478. LIBS_save="${LIBS}"
  479. LIBS="${LIBS} -l${libname}"
  480. have_lib=""
  481. echo checking for -ldnet
  482. cat > conftest.c <<EOF
  483.  
  484. main() { exit(0); } 
  485. t() { main(); }
  486. EOF
  487. if eval $compile; then
  488.   have_lib="1"
  489. fi
  490. rm -f conftest*
  491. LIBS="${LIBS_save}"
  492. if test -n "${have_lib}"; then
  493.    :; wlibs="$wlibs -ldnet"
  494.      have_dnet=t
  495.      echo "(adding -ldnet to wlibs)"
  496. else
  497.    :; 
  498. fi
  499.  
  500.   if test -z "$have_dnet"; then
  501.     libname=`echo "dnet_stub" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  502. LIBS_save="${LIBS}"
  503. LIBS="${LIBS} -l${libname}"
  504. have_lib=""
  505. echo checking for -ldnet_stub
  506. cat > conftest.c <<EOF
  507.  
  508. main() { exit(0); } 
  509. t() { main(); }
  510. EOF
  511. if eval $compile; then
  512.   have_lib="1"
  513. fi
  514. rm -f conftest*
  515. LIBS="${LIBS_save}"
  516. if test -n "${have_lib}"; then
  517.    :; wlibs="$wlibs -ldnet_stub"
  518.        echo "(adding -ldnet_stub to wlibs)"
  519. else
  520.    :; 
  521. fi
  522.  
  523.   fi
  524.   # lieder@skyler.mavd.honeywell.com says without -lsocket,
  525.   # socket/setsockopt and other routines are undefined under SCO ODT 2.0.
  526.   libname=`echo "socket" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  527. LIBS_save="${LIBS}"
  528. LIBS="${LIBS} -l${libname}"
  529. have_lib=""
  530. echo checking for -lsocket
  531. cat > conftest.c <<EOF
  532.  
  533. main() { exit(0); } 
  534. t() { main(); }
  535. EOF
  536. if eval $compile; then
  537.   have_lib="1"
  538. fi
  539. rm -f conftest*
  540. LIBS="${LIBS_save}"
  541. if test -n "${have_lib}"; then
  542.    :; wlibs="$wlibs -lsocket"
  543.      echo "(adding -lsocket to wlibs)"
  544. else
  545.    :; 
  546. fi
  547.  
  548. fi
  549. test -n "$xlibdir" && echo "(using $xlibdir)"
  550.  
  551. echo checking for X11/X.h
  552. cat > conftest.c <<EOF
  553.  
  554. #include <X11/X.h>
  555. EOF
  556. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  557. if test -z "$err"; then
  558.   DEFS="$DEFS -DHAVE_X11_X_H=1"; LIBS="$LIBS -lX11"
  559. fi
  560. rm -f conftest*
  561.  
  562.  
  563. echo checking for return type of signal handlers
  564. cat > conftest.c <<EOF
  565. #include <sys/types.h>
  566. #include <signal.h>
  567. #ifdef signal
  568. #undef signal
  569. #endif
  570. extern void (*signal ()) ();
  571. main() { exit(0); } 
  572. t() { int i; }
  573. EOF
  574. if eval $compile; then
  575.   DEFS="$DEFS -DRETSIGTYPE=void"
  576. else
  577.   DEFS="$DEFS -DRETSIGTYPE=int"
  578. fi
  579. rm -f conftest*
  580.  
  581.  
  582. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  583. # for constant arguments.  Useless!
  584. echo checking for working alloca.h
  585. cat > conftest.c <<EOF
  586. #include <alloca.h>
  587. main() { exit(0); } 
  588. t() { char *p = alloca(2 * sizeof(int)); }
  589. EOF
  590. if eval $compile; then
  591.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  592. fi
  593. rm -f conftest*
  594.  
  595. decl="#ifdef __GNUC__
  596. #define alloca __builtin_alloca
  597. #else
  598. #if HAVE_ALLOCA_H
  599. #include <alloca.h>
  600. #else
  601. #ifdef _AIX
  602.  #pragma alloca
  603. #else
  604. char *alloca ();
  605. #endif
  606. #endif
  607. #endif
  608. "
  609. echo checking for alloca
  610. cat > conftest.c <<EOF
  611. $decl
  612. main() { exit(0); } 
  613. t() { char *p = (char *) alloca(1); }
  614. EOF
  615. if eval $compile; then
  616.   :
  617. else
  618.   alloca_missing=1
  619. fi
  620. rm -f conftest*
  621.  
  622. if test -n "$alloca_missing"; then
  623.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  624.   # that cause trouble.  Some versions do not even contain alloca or
  625.   # contain a buggy version.  If you still want to use their alloca,
  626.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  627.   ALLOCA=alloca.o
  628. fi
  629.  
  630. for func in random strftime mktime xmalloc
  631. do
  632. echo checking for ${func}
  633. cat > conftest.c <<EOF
  634.  
  635. main() { exit(0); } 
  636. t() { 
  637. /* Override any gcc2 internal prototype to avoid an error.  */
  638. extern char ${func}(); ${func}(); }
  639. EOF
  640. if eval $compile; then
  641.   :
  642. else
  643.   LIBOBJS="$LIBOBJS ${func}.o"
  644. fi
  645. rm -f conftest*
  646.  
  647. done
  648.  
  649.  
  650. prog='/* Ultrix mips cc rejects this.  */
  651. typedef int charset[2]; const charset x;
  652. /* SunOS 4.1.1 cc rejects this. */
  653. char const *const *p;
  654. char **p2;
  655. /* HPUX 7.0 cc rejects these. */
  656. ++p;
  657. p2 = (char const* const*) p;'
  658. echo checking for working const
  659. cat > conftest.c <<EOF
  660.  
  661. main() { exit(0); } 
  662. t() { $prog }
  663. EOF
  664. if eval $compile; then
  665.   :
  666. else
  667.   DEFS="$DEFS -Dconst="
  668. fi
  669. rm -f conftest*
  670.  
  671.  
  672. need_doprnt=
  673. echo checking for vfprintf
  674. cat > conftest.c <<EOF
  675.  
  676. main() { exit(0); } 
  677. t() { vfprintf(); }
  678. EOF
  679. if eval $compile; then
  680.   :
  681. else
  682.   LIBOBJS="$LIBOBJS vfprintf.o"; need_doprnt=1
  683. fi
  684. rm -f conftest*
  685.  
  686. echo checking for vsprintf
  687. cat > conftest.c <<EOF
  688.  
  689. main() { exit(0); } 
  690. t() { vsprintf(); }
  691. EOF
  692. if eval $compile; then
  693.   :
  694. else
  695.   LIBOBJS="$LIBOBJS vsprintf.o"; need_doprnt=1
  696. fi
  697. rm -f conftest*
  698.  
  699. if test $need_doprnt; then
  700.   for func in _doprnt
  701. do
  702. echo checking for ${func}
  703. cat > conftest.c <<EOF
  704.  
  705. main() { exit(0); } 
  706. t() { 
  707. /* Override any gcc2 internal prototype to avoid an error.  */
  708. extern char ${func}(); ${func}(); }
  709. EOF
  710. if eval $compile; then
  711.   :
  712. else
  713.   LIBOBJS="$LIBOBJS ${func}.o"
  714. fi
  715. rm -f conftest*
  716.  
  717. done
  718.  
  719. fi
  720.  
  721. libname=`echo "termcap" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  722. LIBS_save="${LIBS}"
  723. LIBS="${LIBS} -l${libname}"
  724. have_lib=""
  725. echo checking for -ltermcap
  726. cat > conftest.c <<EOF
  727.  
  728. main() { exit(0); } 
  729. t() { main(); }
  730. EOF
  731. if eval $compile; then
  732.   have_lib="1"
  733. fi
  734. rm -f conftest*
  735. LIBS="${LIBS_save}"
  736. if test -n "${have_lib}"; then
  737.    :; \
  738.         LIBS="$LIBS -lcurses -ltermcap"
  739. else
  740.    :; \
  741.         libname=`echo "termlib" | sed 's/lib\(^\.*\)\.a/\1/;s/-l//'`
  742. LIBS_save="${LIBS}"
  743. LIBS="${LIBS} -l${libname}"
  744. have_lib=""
  745. echo checking for -ltermlib
  746. cat > conftest.c <<EOF
  747.  
  748. main() { exit(0); } 
  749. t() { main(); }
  750. EOF
  751. if eval $compile; then
  752.   have_lib="1"
  753. fi
  754. rm -f conftest*
  755. LIBS="${LIBS_save}"
  756. if test -n "${have_lib}"; then
  757.    :; \
  758.                 LIBS="$LIBS -lcurses -ltermlib"
  759. else
  760.    :; \
  761.                 LIBS="$LIBS -lcurses"
  762. fi
  763.  
  764. fi
  765.  
  766.  
  767. LIBS_save="$LIBS"
  768. LIBS="$LIBS -lm"
  769. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  770. for func in rint rename \
  771.           getcap stricmp strincmp \
  772.           strdup strstr strftime mktime
  773. do
  774. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  775. echo checking for ${func}
  776. cat > conftest.c <<EOF
  777. #include <stdio.h>
  778. main() { exit(0); } 
  779. t() { 
  780. #ifdef __stub_${func}
  781. choke me
  782. #else
  783. /* Override any gcc2 internal prototype to avoid an error.  */
  784. extern char ${func}(); ${func}();
  785. #endif
  786.  }
  787. EOF
  788. if eval $compile; then
  789.   DEFS="$DEFS -D${trfunc}=1"
  790. fi
  791. rm -f conftest*
  792. #endif
  793. done
  794.  
  795. echo checking for cbreak
  796. cat > conftest.c <<EOF
  797. #include <curses.h>
  798. main() { exit(0); } 
  799. t() { cbreak(); }
  800. EOF
  801. if eval $compile; then
  802.   DEFS="$DEFS -DHAVE_CBREAK=1"
  803. fi
  804. rm -f conftest*
  805.  
  806. LIBS="$LIBS -lm"
  807. echo checking for hypot
  808. cat > conftest.c <<EOF
  809.  
  810. main() { exit(0); } 
  811. t() { hypot(); }
  812. EOF
  813. if eval $compile; then
  814.   DEFS="$DEFS -DHAVE_HYPOT=1"
  815. fi
  816. rm -f conftest*
  817.  
  818. LIBS="$LIBS_save"
  819. echo checking for bogus definition of __GNUC__
  820. cat > conftest.c <<EOF
  821. static int x = 54;
  822. main() { exit(0); } 
  823. t() { 
  824. #if defined (__GNUC__) && __GNUC__ >= 2
  825. exit (__extension__ x);
  826. #endif
  827.  }
  828. EOF
  829. if eval $compile; then
  830.   echo looks ok
  831. else
  832.   DEFS="$DEFS -D__extension__"
  833. fi
  834. rm -f conftest*
  835.  
  836. if test -n "$prefix"; then
  837.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  838.   prsub="s%^prefix[     ]*=.*$%prefix = $prefix%"
  839. fi
  840. if test -n "$exec_prefix"; then
  841.   prsub="$prsub
  842. s%^exec_prefix[     ]*=.*$%exec_prefix = $exec_prefix%"
  843. fi
  844.  
  845. trap 'rm -f config.status; exit 1' 1 3 15
  846. echo creating config.status
  847. rm -f config.status
  848. cat > config.status <<EOF
  849. #!/bin/sh
  850. # Generated automatically by configure.
  851. # Run this file to recreate the current configuration.
  852. # This directory was configured as follows,
  853. # on host `(hostname || uname -n) 2>/dev/null`:
  854. #
  855. # $0 $*
  856.  
  857. if test \$# -gt 0; then
  858.   case "\$1" in
  859.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  860.     exec /bin/sh $0 $* ;;
  861.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  862.   esac
  863. fi
  864.  
  865. trap 'rm -f Makefile; exit 1' 1 3 15
  866. LIBS='$LIBS'
  867. CC='$CC'
  868. CPP='$CPP'
  869. YACC='$YACC'
  870. INSTALL='$INSTALL'
  871. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  872. INSTALL_DATA='$INSTALL_DATA'
  873. xincludedir='$xincludedir'
  874. xlibdir='$xlibdir'
  875. wlibs='$wlibs'
  876. ALLOCA='$ALLOCA'
  877. LIBOBJS='$LIBOBJS'
  878. srcdir='$srcdir'
  879. DEFS='$DEFS'
  880. prefix='$prefix'
  881. exec_prefix='$exec_prefix'
  882. prsub='$prsub'
  883. EOF
  884. cat >> config.status <<\EOF
  885.  
  886. top_srcdir=$srcdir
  887. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  888.   srcdir=$top_srcdir
  889.   # Remove last slash and all that follows it.  Not all systems have dirname.
  890.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  891.   if test "$dir" != "$file"; then
  892.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  893.     test ! -d $dir && mkdir $dir
  894.   fi
  895.   echo creating $file
  896.   rm -f $file
  897.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  898.   sed -e "
  899. $prsub
  900. s%@LIBS@%$LIBS%g
  901. s%@CC@%$CC%g
  902. s%@CPP@%$CPP%g
  903. s%@YACC@%$YACC%g
  904. s%@INSTALL@%$INSTALL%g
  905. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  906. s%@INSTALL_DATA@%$INSTALL_DATA%g
  907. s%@xincludedir@%$xincludedir%g
  908. s%@xlibdir@%$xlibdir%g
  909. s%@wlibs@%$wlibs%g
  910. s%@ALLOCA@%$ALLOCA%g
  911. s%@LIBOBJS@%$LIBOBJS%g
  912. s%@srcdir@%$srcdir%g
  913. s%@DEFS@%$DEFS%
  914. " $top_srcdir/${file}.in >> $file
  915. fi; done
  916.  
  917. EOF
  918. chmod +x config.status
  919. test -n "$no_create" || ./config.status
  920.  
  921.